using System.IO;

namespace cssp
{
	public enum TokenType { Word, QuotedString, Other }

	public class Token
	{
		public TokenType Type;
		public int Row; // line number
		public int Col; // line offset
		public int Offset; // number of characters from start of text to start of token
		public string Value;

		public Token(TokenType type, int row, int col, int offset, string value)
		{
			Type = type;
			Row = row;
			Col = col;
			Offset = offset;
			Value = value;
		}
	}

	public delegate void TokenDelegate(Token[] tokens);

	public interface ICssxScanner
	{
		/// <summary>
		/// Returns the current line number.
		/// </summary>
		int LineNumber { get; }

		/// <summary>
		/// Gets/sets the callback function to call when a token is found
		/// </summary>
		TokenDelegate OnToken { get; set; }

		void Scan(TextReader reader);
	}
}
